import request from '@/utils/request'

// 获取所有的角色信息
export function getRoleList() {
  return request({
    url: '/admin/ucenter/role/getRoleList',
    method: 'GET'
  })
}

// 添加角色
export function addRole(form) {
  return request({
    url: '/admin/ucenter/role/save',
    method: 'POST',
    data: form
  })
}

// 删除角色
export function deleteRole(id) {
  return request({
    url: `/admin/ucenter/role/remove/${id}`,
    method: 'DELETE'
  })
}

// 给角色分配权限
export function assignRights(id, rightIds) {
  return request({
    url: `/admin/ucenter/role/assignRights/${id}/${rightIds}`,
    method: 'POST'
  })
}

// 获取所有角色名称
export function getRoleNameList() {
  return request({
    url: '/admin/ucenter/role/getRoleNameList',
    method: 'GET'
  })
}
